//引入依赖
import request from "@/utils/request.js"
import { parseMinWidth } from "element-plus/es/components/table/src/util"

//获取单个学生
export const getStudentService=(id)=>{
    return request.get("/member/student/0?userId="+id)
}

//获取单个老师
export const getTeacherService=(id)=>{
    return request.get("/member/teacher/1?userId="+id)
}

//上传附件
export const uploadService=(file,type)=>{
    const files = new FormData();
        files.append('files', file.raw)
   return request.post(`/project/upload/${type}`,files)
}

//项目申请
export const applicationService=(params)=>{
    return request.post("/project",params)
}

//获取立项审核列表
export const getBeginService=(params)=>{
        return request.get("/project/establishment",{params:params})
}
//获取中期审核列表
export const getMidService=(params)=>{
    return request.get("/project/mid_term",{params:params})
}
//获取结项审核列表
export const getEndService=(params)=>{
    return request.get("/project/closing_item",{params:params})
}

//获取项目进展
export const getProgressService=(params)=>{
    return request.get("/project/logCount",{params:params})
}

//获取项目详情
export const getDetailData=(id)=>{
    return request.get("/project/proDetail?projectId="+id)
}

//获取失败详情
export const getErrorDetailService=(type,id)=>{
    return request.get(`/project/errorDetail/${type}?projectId=`+id)
}
//上传中期附件
export const uploadMidService=(params,projectId)=>{

    return request.post(`/project/upload/1/${projectId}`,params)
}
//提交延期申请
export const sumbitExtension=(projectId,type,msg)=>{
    return request.post(`/project/extension/${type}/${projectId}?msg=`,msg)

}

//进入结项材料提交页面
export const sumbitAccessoryService=(id)=>{
    return request.get("/project/toClose?projectId="+id)
}

//进行结项材料提交
export const postEndAccessoryService=(params)=>{
        return request.post("/project/submittals_close",params)
}

//更改中期成员
export const changeMemberService=(params)=>{
   

    return request.put('/project/modify_members',params)
}


